package com.dadaguai.enums;

public enum SysSettingCodeEnum {

    AUDIT("audit", "com.dadaguai.dto.SystemDto.SystemSetting4AuditDto", "audioSetting", "审核设置"),
    COMMENT("comment", "com.dadaguai.dto.SystemDto.SystemSetting4CommentDto", "commentSetting", "评论设置"),
    EMAIL("email", "com.dadaguai.dto.SystemDto.SystemSetting4EmailDto", "emailSetting", "邮件设置"),
    LIKE("like", "com.dadaguai.dto.SystemDto.SystemSetting4LikeDto", "likeSetting", "点赞设置"),
    POST("post", "com.dadaguai.dto.SystemDto.SystemSetting4PostDto", "postSetting", "发帖设置"),
    REGISTER("register", "com.dadaguai.dto.SystemDto.SystemSetting4RegisterDto", "registerSetting", "注册设置");
    private String code;
    private String clazz;
    private String propName;
    private String desc;

     SysSettingCodeEnum(String code, String clazz, String propName, String desc) {
        this.code = code;
        this.clazz = clazz;
        this.propName = propName;
        this.desc = desc;
    }

    /**
     * 根据code获取枚举对象
     * @param code
     * @return
     */
    public static SysSettingCodeEnum getByCode(String code){
         for (SysSettingCodeEnum item: SysSettingCodeEnum.values()){
             if (item.getCode().equals(code)) return item;
         }
         return null;
    }

    public String getCode() {
        return code;
    }

    public String getClazz() {
        return clazz;
    }

    public String getPropName() {
        return propName;
    }

    public String getDesc() {
        return desc;
    }
}
